home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / typeinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  1.8 KB  |  100 lines

  1. /*  typeinfo.h
  2.  
  3.     Definitions for RTTI
  4. */
  5.  
  6. /*
  7.  *      C/C++ Run Time Library - Version 9.0
  8.  *
  9.  *      Copyright (c) 1993, 1998 by Borland International
  10.  *      All Rights Reserved.
  11.  *
  12.  */
  13. /* $Revision:   9.8  $ */
  14.  
  15. #if !defined(__cplusplus)
  16. #error Must use C++ for typeinfo.h
  17. #endif
  18.  
  19. #ifndef __TYPEINFO_H
  20. #define __TYPEINFO_H
  21.  
  22. #ifndef ___STDDEF_H
  23. #include <_stddef.h>
  24. #endif
  25.  
  26. #if !defined(RC_INVOKED)
  27.  
  28. #if defined(__STDC__)
  29. #pragma warn -nak
  30. #endif
  31.  
  32. #pragma option  -Vt-                    // make sure vtable pointer is 'low'
  33. #pragma option  -RT
  34.  
  35. #endif  /* !RC_INVOKED */
  36.  
  37.  
  38. #if defined(_BUILDRTLDLL) || defined(_RTLDLL)
  39. #   define _TIDIST   _EXPCLASS
  40. #else
  41. #     define _TIDIST
  42. #endif
  43.  
  44. class                   tpid;
  45.  
  46. class   _TIDIST  __rtti type_info
  47. {
  48.  
  49. public:
  50.  
  51.         tpid          * tpp;
  52.  
  53. private:
  54.                 __cdecl type_info(const type_info _FAR &);
  55.     type_info &  __cdecl operator=(const type_info _FAR &);
  56.  
  57. public:
  58.  
  59.     virtual     __cdecl ~type_info();
  60.  
  61.     bool        __cdecl operator==(const type_info _FAR &) const;
  62.     bool        __cdecl operator!=(const type_info _FAR &) const;
  63.  
  64.     bool        __cdecl before(const type_info _FAR &) const;
  65.  
  66.     const char _FAR *__cdecl name() const;
  67. protected:
  68.                 __cdecl type_info(tpid *_tpp) { tpp = _tpp; }
  69. };
  70.  
  71.  
  72. class   bad_cast{};
  73. class   bad_typeid{};
  74.  
  75. #if !defined(__STDC__)
  76. // The following are for backwards compatibility.
  77. typedef type_info  typeinfo;
  78. typedef type_info  Type_info;
  79. typedef bad_cast   Bad_cast;
  80. typedef bad_typeid Bad_typeid;
  81.  
  82. #pragma obsolete typeinfo
  83. #pragma obsolete Type_info
  84. #pragma obsolete Bad_cast
  85. #pragma obsolete Bad_typeid
  86. #endif
  87.  
  88. #if !defined(RC_INVOKED)
  89.  
  90. #pragma option  -RT.
  91. #pragma option  -Vt.
  92.  
  93. #if defined(__STDC__)
  94. #pragma warn .nak
  95. #endif
  96.  
  97. #endif  /* !RC_INVOKED */
  98.  
  99. #endif
  100.